package fristphase.day9_07.day06;

import java.util.Random;

public class MaxOfArray {
    public static void main(String[] args) {
        int[] array = new int[10];
        Random  random = new Random();
        for (int i = 0; i < 10; i++) {
            array[i] = random.nextInt(100);
            System.out.print(array[i]+" ");
        }
        System.out.println();
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array.length; j++) {
                if(j+1<array.length){
                    int max = array[j];
                    int mix = array[j+1];
                    if(max>mix){
                        array[j+1] = max;
                        array[j] = mix;
                    }
            }

            }

        }
        System.out.println();
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+" ");
        }
    }
}
